package com.transcasafe.eanpay.core.auth;


import com.transcasafe.eanpay.core.cipher.EanPayVerifier;
import com.transcasafe.eanpay.core.http.HttpHeaders;

import static java.util.Objects.requireNonNull;

/**
 * 支付验证器
 */
public final class EanPayValidator implements Validator {

    private final EanPayVerifier verifier;

    public EanPayValidator(EanPayVerifier verifier) {
        this.verifier = requireNonNull(verifier);
    }

    @Override
    public <T> boolean validate(HttpHeaders responseHeaders, String responseBody) {
        return verifier.verify(responseHeaders, responseBody);
    }
}
